package com.spring.service.Impl;

import com.spring.dao.AccountDao;
import com.spring.dao.Impl.AccountDaoImpl;
import com.spring.pojo.Account;
import com.spring.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;





@Service(value = "accountService")
public class AccountServiceImpl implements AccountService {


    @Autowired
    private AccountDao accountDao;


    @Override
    public List<Account> findAll() {
        List<Account> all = accountDao.findAll();
        return all;
    }

    @Override
    public List<Account> findById(Integer id) {
        List<Account> byId = accountDao.findById(id);
        return byId;
    }

    @Override
    public void Save(Account account) {
        accountDao.Save(account);
    }

    @Override
    public void Update(Account account) {
        accountDao.Update(account);
    }

    @Override
    public void Delete(Integer id) {
        accountDao.Delete(id);
    }
}
